import java.util.*;
public class Main {

    public static void main(String[] args) {
        int[] arr = new int[5];
        Scanner sc = new Scanner(System.in);
        while(true){
            try{
                switch (sc.next()) {
                case "arr":
                    int c = arr[sc.nextInt()];
                        break;
                   
                case "null":
                    throw new NullPointerException();
   
                   
                case "cast":
                    Object obj = new String("o");
                    Integer h = (Integer)obj;

       
                    throw new ClassCastException();
   
                case "num":
                    Integer b = Integer.parseInt(sc.next());
                default:
                    break;
               
            }
            }catch(ArrayIndexOutOfBoundsException e){
                System.out.println(e);
            }
            catch(NullPointerException e){
                System.out.println(e);
            }
            catch(ClassCastException e){
                System.out.println(e);
            }
            catch(NumberFormatException e){
                System.out.println(e);
            }
           
           
        }

    }

}